/**
 *
 */
package com.wedroid.r2d2.support.sync;

/**
 * @author lute
 */
public enum SyncAction {

    /** 运行正常 */
    SYNCING(0),

    /** 客户端登出 */
    LOGOUT(1101),

    /** 有可能表示掉线 */
    OFFLINE(1102),

    /** 账号被挤下线 */
    OUT(1100),

    /** 未知 */
    UNKNOWN(-1);

    private int retCode;

    /**
     * @param retCode
     */
    private SyncAction(int retCode) {
        this.retCode = retCode;
    }

    /**
     * @param retCode
     * @return
     */
    public static final SyncAction retCodeOf(int retCode) {
        for (SyncAction action : SyncAction.values()) {
            if (action.retCode == retCode) {
                return action;
            }
        }
        return SyncAction.UNKNOWN;
    }

    /**
     * @return the retCode
     */
    public int getRetCode() {
        return retCode;
    }

}
